package com.concurrent.frame.factory;

import com.concurrent.frame.mark.ThreadSafe;
import com.concurrent.frame.processor.task.AbsTaskSingleProcessor;
import com.concurrent.frame.processor.task.ITaskProcessor;
import com.concurrent.frame.pojo.JobInfo;
@ThreadSafe
public class JobInfoFactory {
    private static JobInfo generateJobInfo(String jobName, Integer jobLength,boolean isCache,Long expireTime){
        return new JobInfo(jobName,jobLength, isCache,expireTime);
    }
    //缓存并且支持定时删除
    public static JobInfo generateCacheAndDelayMissing(String jobName, Integer jobLength,long expireTime){
        return generateJobInfo(jobName,jobLength,true,expireTime);
    }
    //不缓存不支持定时删除
    public static JobInfo generateNotCache(String jobName, Integer jobLength){
        return generateJobInfo(jobName,jobLength,false,null);
    }
    //缓存但是不支持定时删除
    public static JobInfo generateCacheAndNotDelayMissing(String jobName, Integer jobLength) {
        return generateJobInfo(jobName, jobLength,   true, -1l);
    }
}
